﻿package view.component.activeBtns
{
    import cmd.*;
    import com.core.*;
    import com.sh.game.global.*;
    import flash.events.*;
    import flash.net.*;
    import manager.*;
    import view.component.*;

    public class ShouCangBtn extends ActiveButton
    {
        private var request:URLRequest;
        private var localRef:FileReference;

        public function ShouCangBtn(param1:Object)
        {
            super(param1);
            var _loc_2:String = "favicon.ico?t=1";
            App.loader.loadBYTE(_loc_2, null, null, null, false);
            return;
        }// end function

        override protected function doClick() : void
        {
            var url:String;
            var name:String;
            if (!this.request)
            {
                if (Config.gameParams.oper == "" || Config.gameParams.oper == "none")
                {
                    url;
                }
                else
                {
                    url = "quick/" + Config.gameParams.oper + ".url";
                }
                this.request = new URLRequest(url);
                this.localRef = new FileReference();
                this.localRef.addEventListener(Event.COMPLETE, this.loadComplete);
            }
            try
            {
                name = Config.gameParams.gamename;
                if (name == null)
                {
                    name;
                }
                this.localRef.download(this.request, name + ".url");
            }
            catch (error:Error)
            {
            }
            return;
        }// end function

        protected function loadComplete(event:Event) : void
        {
            PluginManager.instance.sendToBufferServer("activity", CMDActivity.ReqCollectRewardMessage, null);
            ModelProxy.change("mainui", "removeBtn", _btnMsg.name);
            return;
        }// end function

    }
}
